package com.tedu.mybatis.mapper;


import com.tedu.mybatis.pojo.Comment;
import com.tedu.mybatis.pojo.CommentVO1;
import com.tedu.mybatis.pojo.CommentVO2;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CommentMapper {
    //@Insert("INSERT INTO comment(content,user_id,weibo_id) VALUES (#{content},#{userId},#{weiboId})")
    int insertComment(Comment comment);

    //@Delete("DELETE FROM comment WHERE id = #{id}")
    int deleteCommentById(Integer id);

    //@Update("UPDATE comment SET content = #{content},created = #{created} WHERE id = #{id}")
    int updateCommentById(Comment comment);

    //@Select("SELECT content,user_id userId FROM comment WHERE id = #{id}")
    CommentVO1 selectSingleCommentById(Integer id);

    //@Select("SELECT id,content,user_id userId FROM comment WHERE user_id = #{id}")
    CommentVO2[] selectAllCommentById(Integer id);
}
